package org.yyf.resource.demo.socket;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * socket服务端
 * @author YYF
 *
 */
public class SocketServer {
	

	public static void main(String[] args) throws Exception {
		// 监听指定的端口
		int port = 55533;
		ServerSocket server = new ServerSocket(port);

		System.out.println("server将一直等待连接的到来");
		while(true) {
			Socket socket = server.accept();
			new Thread(new SocketThead(socket)).start();
		}
		
	}
}
